home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2002 November / CD 1 / APC0211D1.ISO / workshop / prog / files / ActivePerl-5.6.1.633-MSWin32.msi / _56ffdaeb06ca34c25c79f8f6bf2adeae < prev    next >
Encoding:
Text File  |  2002-06-17  |  1.3 KB  |  49 lines

  1. # NOTE: Derived from ..\blib\lib\Tk\Listbox.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package Tk::Listbox;
  5.  
  6. #line 317 "..\blib\lib\Tk\Listbox.pm (autosplit into ..\blib\lib\auto\Tk\Listbox\AutoScan.al)"
  7. # AutoScan --
  8. # This procedure is invoked when the mouse leaves an entry window
  9. # with button 1 down. It scrolls the window up, down, left, or
  10. # right, depending on where the mouse left the window, and reschedules
  11. # itself as an "after" command so that the window continues to scroll until
  12. # the mouse moves back into the window or the mouse button is released.
  13. #
  14. # Arguments:
  15. # w - The entry window.
  16. # x - The x-coordinate of the mouse when it left the window.
  17. # y - The y-coordinate of the mouse when it left the window.
  18. sub AutoScan
  19. {
  20.  my $w = shift;
  21.  my $x = shift;
  22.  my $y = shift;
  23.  if ($y >= $w->height)
  24.   {
  25.    $w->yview('scroll',1,'units')
  26.   }
  27.  elsif ($y < 0)
  28.   {
  29.    $w->yview('scroll',-1,'units')
  30.   }
  31.  elsif ($x >= $w->width)
  32.   {
  33.    $w->xview('scroll',2,'units')
  34.   }
  35.  elsif ($x < 0)
  36.   {
  37.    $w->xview('scroll',-2,'units')
  38.   }
  39.  else
  40.   {
  41.    return;
  42.   }
  43.  $w->Motion($w->index("@" . $x . ',' . $y));
  44.  $w->RepeatId($w->after(50,'AutoScan',$w,$x,$y));
  45. }
  46.  
  47. # end of Tk::Listbox::AutoScan
  48. 1;
  49.